<style>
	.oss-operation-form .operationType{
		display: none;
	}
</style>
<script>
	$(function(){
		var operationType = ".oss-operation-form [name=operationType]";
		$("."+$(operationType).val()).show();
		layui.form.on('select(otf)',function(data){
			$(".oss-operation-form .operationType").hide();
			$("."+data.value).show();
		})
	})
</script>
<div class="layui-tab layui-tab-fixed layui-tab-brief">
  <ul class="layui-tab-title">
    <li class="layui-this">基本配置</li>
  </ul>
  <div class="layui-tab-content editor-form-node">
    <div class="layui-tab-item layui-show">
    	<form class="layui-form oss-operation-form">
    		<div class="layui-form-item">
    			<label class="layui-form-label">节点名称</label>
    			<div class="layui-input-block">
    				<input type="text" name="value" placeholder="请输入节点名称" value="{{=d.value}}" autocomplete="off" class="layui-input">
    			</div>
    		</div>
    		<div class="layui-form-item">
    			<label class="layui-form-label">变量名称</label>
    			<div class="layui-input-block">
    				<input type="text" name="variableName" placeholder="请输入变量名称" value="{{=d.data.object.variableName}}" autocomplete="off" class="layui-input">
    			</div>
    		</div>
    		<div class="layui-form-item">
    			<label class="layui-form-label">选择OSS</label>
    			<div class="layui-input-block">
    				<select name="ossId">
    					{{# for(var ossIndex in d.model.cells){ }}
    						{{# var cell = d.model.cells[ossIndex] }}
    						{{# if(cell.data&&cell.data.get('shape') == 'oss'){ }}
    							<option value="{{=ossIndex}}" {{ossIndex == d.data.object.ossId ? 'selected': ''}}>{{cell.value}}</option>
    						{{# } }}
    					{{# } }}
    				</select>
    			</div>
    		</div>
    		<div class="layui-form-item">
    			<label class="layui-form-label">OSS操作</label>
    			<div class="layui-input-block">
    				<select name="operationType" lay-filter="otf">
 						<option value="ossPut" {{d.data.object.operationType == 'ossPut' ? 'selected': ''}}>上传</option>
 						<option value="ossDelete" {{d.data.object.operationType == 'ossDelete' ? 'selected': ''}}>删除</option>
    				</select>
    			</div>
    		</div>
    		<div class="operationType ossPut">
    			<div class="layui-form-item">
	    			<label class="layui-form-label">文件流</label>
	    			<div class="layui-input-block">
	    				<input type="text" name="bytes" placeholder="请输入文件流" value="{{=d.data.object.bytes}}" autocomplete="off" class="layui-input">
	    			</div>
	    		</div>
	    		<div class="layui-form-item">
	    			<label class="layui-form-label">文件名称</label>
	    			<div class="layui-input-block">
	    				<input type="text" name="fileName" placeholder="请输入文件名称" value="{{=d.data.object.fileName}}" autocomplete="off" class="layui-input">
	    			</div>
	    		</div>
    		</div>
    		<div class="operationType ossDelete">
	    		<div class="layui-form-item">
	    			<label class="layui-form-label">文件路径</label>
	    			<div class="layui-input-block">
	    				<input type="text" name="filePath" placeholder="请输入文件路径/名称（例如“test/a.txt”）" value="{{=d.data.object.filePath}}" autocomplete="off" class="layui-input">
	    			</div>
	    		</div>
    		</div>
    	</form>
    </div>
  </div>
</div>
